/*
 * Copyright (c) 2024 Shenzhen Kaihong Digital Industry Development Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SLE_LITE_TOOL_HOST_H
#define SLE_LITE_TOOL_HOST_H

#include "kh_sle_host.h"
#include "cmd_input.h"
#include "sle_hilog.h"

#include <stdio.h>
#include <string.h>
#include <stdint.h>

#ifdef __LITEOS_M__
#include "common_tool.h"
#include "ohos_init.h"
#include "cmsis_os2.h"
#include "utils_file.h"
#include "sle_lite_advance_setting.h"
#endif // __LITEOS_M__

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void OnSleTHostStateChangeCb(SleDeviceState state);
static SleHostCallbacks g_hostToolCbs = {
    .OnSleHostStateChangeCb = OnSleTHostStateChangeCb,
};

void TSleEnable(void);
void TSleDisable(void);
void TGetSleState(void);
void TSetHostAddress(void);
void TGetHostAddress(void);
void TSetHostName(void);
void TGetHostName(void);
void TGetHostConnCfg(void);
void SleHostToolHalper(void);
void TSleUapiNvRead(void);
void TSleUapiNvWrite(void);


static CmdNode g_hostCmdList[] = {
    //sle_host_test
    {"SleHostHalper", SleHostToolHalper},
    {"SleEnable", TSleEnable},
    {"SleDisable", TSleDisable},
    {"GetSleState", TGetSleState},
    {"GetHostAddress", TGetHostAddress},
    {"SetHostName", TSetHostName},
    {"GetHostName", TGetHostName},
    {"GetHostDefaultConnectConfig", TGetHostConnCfg},
    {"UapiNvRead", TSleUapiNvRead},
    {"UapiNvWrite", TSleUapiNvWrite},
};
static uint16_t g_hostCmdNum = sizeof(g_hostCmdList) / sizeof(CmdNode);
void SleHostToolCmdHandler(int argc, char **argv);

#ifdef __cplusplus
}
#endif // __cplusplus

#endif // SLE_LITE_TOOL_HOST_H